import request from '@/plugin/axios'
import util from '@/libs/util.js'

export function getComponentStatu(pageno, pagesize, UserId, formdata) {
    var data = {}
    data.pageno = pageno
    data.pagesize = pagesize
    // if (UserId) {
    //     data.UserId = UserId
    // }
    if (formdata) {
        data = Object.assign(formdata, data)
    }
    return request({
        url: '/IFFSystem/ComponentStatus',
        method: 'post',
        data
    })
}

export function getComponentTable(pageno, pagesize, SystemId,formdata) {
    var data = {}
    data.pageno = pageno
    data.pagesize = pagesize
    data.SystemId = SystemId
    // if (UserId) {
    //     data.UserId = UserId
    // }
    if (formdata) {
        data = Object.assign(formdata, data)
    }
    return request({
        url: '/IFFSystem/Component/List',
        method: 'post',
        data
    })
}


export function submitComponent( formdata,project) {
    var data = {}

    // if (UserId) {
    //     data.UserId = UserId
    // }
    if (formdata) {
        data = Object.assign(formdata, project)
    }
    return request({
        url: '/IFFSystem/Component/Add',
        method: 'post',
        data
    })
}
//新建用传系统

export function addIFFSystem(formdata,project) {
    var data = {}

    if (formdata) {
        data = Object.assign(formdata, project)
    }
    return request({
        url: '/IFFSystem/Add',
        method: 'post',
        data
    })
}

export function getComponentHistory(pageno, pagesize, Id, time) {
    var data = {}
    data.pagesize = pagesize
    data.Id = Id
    data.pageno = pageno
    data.time = time

    return request({
        url: '/IFFSystem/HisData',
        method: 'post',
        data
    })
}
export function delComponent( id) {
    return request({
        url: '/IFFSystem/Delete',
        method: 'post',
        data:{
            Id:id
        }
    })
}
